
package com.clps.dev.sms.entity.sm;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.UpdateTimestamp;

/**  
* @ClassName: Department  
* @Description: Department 实体类
* @since JDK 1.8 
* @author RuiShan.Yang  
* @date 2018-11-26 16:27:59  
* 
*/
@Entity
@Table(name = "sm_department")
public class Department implements java.io.Serializable {

	/**
	 * serialVersionUID
	 * @since JDK 1.8
	 */
	private static final long serialVersionUID = 1L;

	public static final long getSerialversionuid() {
		return serialVersionUID;
	}

	private Integer departmentId; // 部门编号
	private String departmentName;// 部门名称
	private int departmentHeaderId;// 部门负责人
	private String departmentEmail;// 部门邮箱
	private String departmentDescription;// 部门描述
	private int departmentParentId;// 父部门编号
	private int departmentCreatedEmployeeId;// 创建人名
	private String departmentCreatedTime;// 创建时间
	private int departmentUpdatedEmployeeId;// 更新人名
	private Timestamp departmentUpdatedTime;// 更新时间

	public Department() {
	}

	/**  
	* 创建一个新的实例 Department.  
	*
	*/
	public Department(String departmentName, int departmentHeaderId, String departmentEmail,
			String departmentDescription, int departmentParentId, int departmentCreatedEmployeeId,
			String departmentCreatedTime, int departmentUpdatedEmployeeId) {
		this.departmentName = departmentName;
		this.departmentHeaderId = departmentHeaderId;
		this.departmentEmail = departmentEmail;
		this.departmentDescription = departmentDescription;
		this.departmentParentId = departmentParentId;
		this.departmentCreatedEmployeeId = departmentCreatedEmployeeId;
		this.departmentCreatedTime = departmentCreatedTime;
		this.departmentUpdatedEmployeeId = departmentUpdatedEmployeeId;
	}

	/**
	* <p>Title: equals</p>  
	* <p>Description: </p>  
	* @param obj
	* @return  
	* @see java.lang.Object#equals(java.lang.Object)  
	*/
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}

		if (this.getClass() != obj.getClass()) {
			return false;
		}

		Department department = (Department) obj;
		return this.departmentId.equals(department.getDepartmentId());
	}

	@Column(name = "DEPARTMENT_CREATED_EMPLOYEE_ID", length = 20, nullable = false, updatable = false)
	public int getDepartmentCreatedEmployeeId() {
		return departmentCreatedEmployeeId;
	}

	@Column(name = "DEPARTMENT_CREATED_TIME", length = 50, nullable = false, updatable = false)
	public String getDepartmentCreatedTime() {
		return departmentCreatedTime;
	}

	@Column(name = "DEPARTMENT_DESCRIPTION", length = 255)
	public String getDepartmentDescription() {
		return departmentDescription;
	}

	@Column(name = "DEPARTMENT_EMAIL", length = 50, unique = true)
	public String getDepartmentEmail() {
		return departmentEmail;
	}

	@Column(name = "DEPARTMENT_HEADER_ID", length = 20)
	public int getDepartmentHeaderId() {
		return departmentHeaderId;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "DEPARTMENT_ID", length = 20)
	public Integer getDepartmentId() {
		return this.departmentId;
	}

	@Column(name = "DEPARTMENT_NAME", length = 50, unique = true)
	public String getDepartmentName() {
		return departmentName;
	}

	@Column(name = "DEPARTMENT_PARENTID", length = 20, nullable = false)
	public int getDepartmentParentId() {
		return departmentParentId;
	}

	@Column(name = "DEPARTMENT_UPDATED_EMPLOYEE_ID", length = 20, nullable = false)
	public int getDepartmentUpdatedEmployeeId() {
		return departmentUpdatedEmployeeId;
	}

	@UpdateTimestamp
	@Column(name = "DEPARTMENT_UPDATED_TIME", columnDefinition = "TIMESTAMP")
	public Timestamp getDepartmentUpdatedTime() {
		return departmentUpdatedTime;
	}

	/**
	* <p>Title: hashCode</p>  
	* <p>Description: </p>  
	* @return  departmentId
	* @see java.lang.Object#hashCode()  
	*/
	@Override
	public int hashCode() {
		return this.departmentId;
	}

	public void setDepartmentCreatedEmployeeId(int departmentCreatedEmployeeId) {
		this.departmentCreatedEmployeeId = departmentCreatedEmployeeId;
	}

	public void setDepartmentCreatedTime(String departmentCreatedTime) {
		this.departmentCreatedTime = departmentCreatedTime;
	}

	public void setDepartmentDescription(String departmentDescription) {
		this.departmentDescription = departmentDescription;
	}

	public void setDepartmentEmail(String departmentEmail) {
		this.departmentEmail = departmentEmail;
	}

	public void setDepartmentHeaderId(int departmentHeaderId) {
		this.departmentHeaderId = departmentHeaderId;
	}

	public void setDepartmentId(Integer departmentId) {
		this.departmentId = departmentId;
	}

	public void setDepartmentName(String departmentName) {
		this.departmentName = departmentName;
	}

	public void setDepartmentParentId(int departmentParentId) {
		this.departmentParentId = departmentParentId;
	}

	public void setDepartmentUpdatedEmployeeId(int departmentUpdatedEmployeeId) {
		this.departmentUpdatedEmployeeId = departmentUpdatedEmployeeId;
	}

	public void setDepartmentUpdatedTime(Timestamp departmentUpdatedTime) {
		this.departmentUpdatedTime = departmentUpdatedTime;
	}

	@Override
	public String toString() {
		return "Department [departmentId=" + departmentId + ", departmentName=" + departmentName
				+ ", departmentHeaderId=" + departmentHeaderId + ", departmentEmail=" + departmentEmail
				+ ", departmentDescription=" + departmentDescription + ", departmentParentId=" + departmentParentId
				+ ", departmentCreatedEmployeeId=" + departmentCreatedEmployeeId + ", departmentCreatedTime="
				+ departmentCreatedTime + ", departmentUpdatedEmployeeId=" + departmentUpdatedEmployeeId
				+ ", departmentUpdatedTime=" + departmentUpdatedTime + "]";
	}

}
